package com.itheima.reggie.mapper;


import com.itheima.reggie.entity.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    @Insert("insert into employee values (null,#{username},#{name},#{password},#{phone},#{sex},#{idNumber},1,#{createTime},#{updateTime},#{createUser},#{updateUser})")
    void save(Employee employee) ;

    @Select("select * from employee where username=#{username}")
    Employee login(Employee employee);

    List<Employee> selectByPage(@Param("name") String name);//为啥加param

    @Select("select * from employee where id=#{id} ")
    Employee findById(Long id);

    void update(Employee employee);
}
